package com.d0324;

public class Sheep {
    String name;
    int age;

    public Sheep(String name, int age) {
        this.name = name;
        this.age = age;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public int getAge() {
        return age;
    }

    public void setAge(int age) {
        this.age = age;
    }

    @Override
    protected Object clone() throws CloneNotSupportedException {
        return super.clone();
    }

    public static void main(String[] args) {
        Sheep s1 = new Sheep("Alice",3);
        try {
            Sheep duoli = (Sheep) s1.clone();
            System.out.println("s1==duoli"+(s1==duoli));
            System.out.println(duoli.name+"\t"+duoli.age);
        } catch (CloneNotSupportedException e) {
            e.printStackTrace();
        }

    }
}
